package com.isoft.c2team3service2.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.isoft.c2team3service2.entity.UserPaidPost;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserPaidPostMapper extends BaseMapper<UserPaidPost> {
    // 检查用户是否购买过帖子
    @Select("SELECT COUNT(*) FROM user_paid_post WHERE user_id = #{userId} AND post_id = #{postId}")
    int checkPaidRecord(Integer userId, Integer postId);
}